package cn.k7g.alloytest.mold2;

import cn.k7g.alloy.annotation.MoldContent;
import cn.k7g.alloy.annotation.MoldParam;
import cn.k7g.alloytest.mold.var.StudentVar;
import cn.k7g.alloytest.mold.var.TeacherVar;

import java.time.LocalDateTime;

@MoldContent(execLevel = MoldContent.Level.MIX_UNSAFE)
public interface TplService {
    @MoldContent("学生#{stu.name},  通过老师 #{teacher.name} 缴纳学费 #{money + 1} 元, #{date.toString()}")
    String getMessage(
            String name,
            @MoldParam(var = StudentVar.class, name="stu")
            Long id,
            @MoldParam(var = TeacherVar.class, name="teacher")
            Long teacherId,
            int money,
            LocalDateTime date
    );

    @MoldContent(value = "学生#{stu.name},  通过老师 #{teacher.name} 缴纳学费 #{money + 1} 元, #{date.toString()}", trigger = "#{@pushService.send(_result)}")
    String sendMessage(
            String name,
            @MoldParam(var = StudentVar.class, name="stu")
            Long id,
            @MoldParam(var = TeacherVar.class, name="teacher")
            Long teacherId,
            int money,
            LocalDateTime date
    );
}
